using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class PT_RoleManagerBase
    {
        public PT_RoleManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity Insert(PT_RoleEntity obj)
        { 
            return (PT_RoleEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity Update(PT_RoleEntity obj)
        { 
            return (PT_RoleEntity)Adapter.Update(obj);             
        }
 
 
        public PT_RoleEntity Delete(PT_RoleEntity obj)
        { 
            return (PT_RoleEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity DeleteByRoleId (PT_RoleEntity obj)
        { 
            return (PT_RoleEntity)Adapter.DeleteByField(obj,"RoleId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleId 
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity DeleteByRoleId (int RoleId )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleId = RoleId;  
            return (PT_RoleEntity)Adapter.DeleteByField(obj,"RoleId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity DeleteByRoleName (PT_RoleEntity obj)
        { 
            return (PT_RoleEntity)Adapter.DeleteByField(obj,"RoleName");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien RoleName 
        /// </summary>
        /// <returns>PT_RoleEntity</returns>
        public PT_RoleEntity DeleteByRoleName (string RoleName )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleName = RoleName;  
            return (PT_RoleEntity)Adapter.DeleteByField(obj,"RoleName");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public PT_RoleEntity Select(PT_RoleEntity obj)
        { 
            return (PT_RoleEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_RoleEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_RoleEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new PT_RoleEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new PT_RoleEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_RoleEntity> SelectAllLST()
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_RoleEntity()),new PT_RoleEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_RoleEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_RoleEntity(),option),new PT_RoleEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (PT_RoleEntity obj)
        { 
            return Adapter.SelectByField(obj,"RoleId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (PT_RoleEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"RoleId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectByRoleIdLST (PT_RoleEntity obj)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId"),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectByRoleIdLST (PT_RoleEntity obj,SelectOptions option)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"RoleId",option),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (int RoleId )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleId = RoleId;  
            return Adapter.SelectByField(obj,"RoleId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleId (int RoleId, SelectOptions option)
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleId = RoleId;  
            return Adapter.SelectByField(obj,"RoleId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_RoleEntity> SelectByRoleIdLST (int RoleId )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleId = RoleId;  
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId"),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_RoleEntity> SelectByRoleIdLST (int RoleId, SelectOptions option)
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleId = RoleId;  
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleId",option),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleName (PT_RoleEntity obj)
        { 
            return Adapter.SelectByField(obj,"RoleName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleName (PT_RoleEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"RoleName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectByRoleNameLST (PT_RoleEntity obj)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleName"),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectByRoleNameLST (PT_RoleEntity obj,SelectOptions option)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"RoleName",option),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleName (string RoleName )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleName = RoleName;  
            return Adapter.SelectByField(obj,"RoleName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByRoleName (string RoleName, SelectOptions option)
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleName = RoleName;  
            return Adapter.SelectByField(obj,"RoleName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_RoleEntity> SelectByRoleNameLST (string RoleName )
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleName = RoleName;  
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleName"),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien RoleName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_RoleEntity> SelectByRoleNameLST (string RoleName, SelectOptions option)
        { 
            PT_RoleEntity obj = new PT_RoleEntity();
            obj.RoleName = RoleName;  
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"RoleName",option),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectWithConditionLST (PT_RoleEntity obj)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new PT_RoleEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_RoleEntity></returns>
        public List<PT_RoleEntity> SelectWithConditionLST (PT_RoleEntity obj,SelectOptions option)
        { 
            return  (List<PT_RoleEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new PT_RoleEntity());
        }

}
}
